bitkeeper revision 1.1159.238.3 (4200cd90cCW2XIYxAgdkWL28Tzf-8g)
authoriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Wed, 2 Feb 2005 12:54:40 +0000 (12:54 +0000)
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Wed, 2 Feb 2005 12:54:40 +0000 (12:54 +0000)
Introduce _xmalloc for when you really want just bytes.

Signed-off-by: ian.pratt@cl.cam.ac.uk
xen/arch/x86/microcode.c
xen/arch/x86/pci-pc.c
xen/arch/x86/shadow.c
xen/common/sched_bvt.c
xen/common/slab.c
xen/include/asm-x86/shadow.h
xen/include/xen/slab.h

index 2b5a18da50ac03b1eb3904cb7e5bff3a1af7aac0..d2c87fd6f659d790d1da56187fa0c2864f2417e4 100644 (file)
@@ -84,7 +84,7 @@
 #define DECLARE_MUTEX(_m) spinlock_t _m = SPIN_LOCK_UNLOCKED
 #define down(_m) spin_lock(_m)
 #define up(_m) spin_unlock(_m)
-#define vmalloc(_s) xmalloc(_s)
+#define vmalloc(_s) _xmalloc(_s)
 #define vfree(_p) xfree(_p)
 #define num_online_cpus() smp_num_cpus
 static inline int on_each_cpu(
index cb5889628cd7c24b6cf219d1fcadd5d924e9493c..68f3832bb6c1a3b4c193be9934fcd4cc9ed47063 100644 (file)
@@ -1036,7 +1036,7 @@ struct irq_routing_table * __devinit pcibios_get_irq_routing_table(void)
        if (ret & 0xff00)
                printk(KERN_ERR "PCI: Error %02x when fetching IRQ routing table.\n", (ret >> 8) & 0xff);
        else if (opt.size) {
-               rt = xmalloc(sizeof(struct irq_routing_table) + opt.size);
+               rt = _xmalloc(sizeof(struct irq_routing_table) + opt.size);
                if (rt) {
                        memset(rt, 0, sizeof(struct irq_routing_table));
                        rt->size = opt.size + sizeof(struct irq_routing_table);
index 7fd1bbca52dc4361914c54d6327ce8178a6c87e5..8d5a201cb81077219326c0c2155bd99605b1e0ec 100644 (file)
@@ -185,7 +185,7 @@ int shadow_mode_enable(struct domain *p, unsigned int mode)
     {
         m->shadow_dirty_bitmap_size = (p->max_pages + 63) & ~63;
         m->shadow_dirty_bitmap = 
-            xmalloc(m->shadow_dirty_bitmap_size/8);
+            _xmalloc(m->shadow_dirty_bitmap_size/8);
         if ( m->shadow_dirty_bitmap == NULL )
         {
             m->shadow_dirty_bitmap_size = 0;
index 12c930ac0d29560ac3224ae185d64cd43365afb5..f63dabcb5005fe99cede315dd6abd386c0c0c1f9 100644 (file)
@@ -171,7 +171,7 @@ int bvt_alloc_task(struct exec_domain *ed)
 {
     struct domain *d = ed->domain;
     if ( (d->sched_priv == NULL) ) {
-        if ( (d->sched_priv = new(struct bvt_dom_info)) == NULL )
+        if ( (d->sched_priv = xmalloc(struct bvt_dom_info)) == NULL )
             return -1;
         memset(d->sched_priv, 0, sizeof(struct bvt_dom_info));
     }
index cfbf4022615ace56ffc4539a68f47923f5a9fc0b..140be245680d2a739ed98990667be5c0177c6f1e 100644 (file)
@@ -1449,10 +1449,10 @@ void *xmem_cache_alloc(xmem_cache_t *cachep)
 }
 
 /**
- * xmalloc - allocate memory
+ * _xmalloc - allocate memory
  * @size: how many bytes of memory are required.
  */
-void *xmalloc(size_t size)
+void *_xmalloc(size_t size)
 {
     cache_sizes_t *csizep = cache_sizes;
 
@@ -1548,7 +1548,7 @@ static int xmem_tune_cpucache (xmem_cache_t* cachep, int limit, int batchcount)
         for (i = 0; i< smp_num_cpus; i++) {
             cpucache_t* ccnew;
 
-            ccnew = xmalloc(sizeof(void*)*limit+sizeof(cpucache_t));
+            ccnew = _xmalloc(sizeof(void*)*limit+sizeof(cpucache_t));
             if (!ccnew)
                 goto oom;
             ccnew->limit = limit;
index 37ad49b7fa10541b5d0a28c39694f020a81630a7..9a45f1173718783b3a695b62670d9126787df953 100644 (file)
@@ -616,7 +616,7 @@ static inline void set_shadow_status(
     {
         SH_LOG("Allocate more shadow hashtable blocks.");
 
-        extra = xmalloc(
+        extra = _xmalloc(
             sizeof(void *) + (shadow_ht_extra_size * sizeof(*x)));
 
         /* XXX Should be more graceful here. */
index e08d02b0855dc6b0b43454d0b1385e9b66eb17e5..25406617dcbb2eb0d6f4420ced1846919a68200d 100644 (file)
@@ -46,7 +46,7 @@ extern int xmem_cache_shrink(xmem_cache_t *);
 extern void *xmem_cache_alloc(xmem_cache_t *);
 extern void xmem_cache_free(xmem_cache_t *, void *);
 
-extern void *xmalloc(size_t);
+extern void *_xmalloc(size_t);
 extern void xfree(const void *);
 
 extern int xmem_cache_reap(void);
@@ -54,15 +54,15 @@ extern int xmem_cache_reap(void);
 extern void dump_slabinfo();
 
 /* Nicely typesafe for you. */
-#define xmalloc(type) ((type *)xmalloc(sizeof(type)))
-#define xmalloc_array(type, num) ((type *)xmalloc_array(sizeof(type), (num)))
+#define xmalloc(type) ((type *)_xmalloc(sizeof(type)))
+#define xmalloc_array(type, num) ((type *)_xmalloc_array(sizeof(type), (num)))
 
-static inline void *xmalloc_array(size_t size, size_t num)
+static inline void *_xmalloc_array(size_t size, size_t num)
 {
        /* Check for overflow. */
        if (size && num > UINT_MAX / size)
                return NULL;
-       return xmalloc(size * num);
+       return _xmalloc(size * num);
 }
 #endif /* __ARCH_HAS_SLAB_ALLOCATOR */